package com.maple.webrtc

import android.content.Context
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.maple.webrtc.ui.HomeActivity
import com.maple.webrtc.utils.PermissionUtils

class SplashActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_splash)

        requestPermission()
    }


    private fun requestPermission() {
        PermissionUtils.requestCamera(this,object: PermissionUtils.RequestPermission{
            override fun onRequestPermissionSuccess() {
                startActivity(Intent(this@SplashActivity,HomeActivity::class.java))
                finish()
            }

            override fun onRequestPermissionFailure(context: Context?, permissions: MutableList<String>?) {
            }

            override fun onRequestPermissionFailureWithAskNeverAgain(context: Context?, permissions: MutableList<String>?) {
            }

        })
    }
}